﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

using MobileTasksService.Model.Responses;
using MobileIdeas.MobileTasks.SDK.Services;
using MobileIdeas.MobileTasks.MobileTasksService.Common;

namespace MobileIdeas.MobileTasks.MobileTasksService
{
    /// <summary>
    /// Summary description for MobileTasksService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class MobileTasksService : System.Web.Services.WebService
    {
        private SecurityService securityService;

        public MobileTasksService()
        {
            this.securityService = new SecurityService();
        }

        [WebMethod]
        public LoginResponse Login(string username, string password, int companyId)
        {
            LoginResponse response = new LoginResponse();

            response.PermissionList = EntityTranslator.GetPermissionDtoArray(securityService.Login(username, password, companyId));

            return response;
        }

        [WebMethod]
        public WebServiceBaseResponse Logout(string username, string password, int companyId)
        {
            return new WebServiceBaseResponse();
        }

        [WebMethod]
        public WebServiceBaseResponse CloseTask(string username, string password, int companyId, int taskId)
        {
            return new WebServiceBaseResponse();
        }

        [WebMethod]
        public WebServiceBaseResponse ModifyTask(string username, string password, int companyId, int taskId)
        {

            return new WebServiceBaseResponse();
        }

        [WebMethod]
        public GetTasksResponse GetTasks(string username, string password, int companyId, int clientId, int taskStatus)
        {
            return new GetTasksResponse();
        }
    }
}
